$OpenBSD: patch-configure_ac,v 1.9 2014/10/07 16:05:11 ajacoutot Exp $

XXX old cdparanoia-3.a9.8 (cdparanoia-III-9.8) does not have cache control.

--- configure.ac.orig	Wed Sep 24 10:02:19 2014
+++ configure.ac	Tue Oct  7 16:32:02 2014
@@ -597,6 +597,21 @@ AG_GST_CHECK_FEATURE(ALSA, [ALSA], alsa, [
   ])
 ])
 
+dnl *** sndio ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_SNDIO, true)
+AG_GST_CHECK_FEATURE(SNDIO, [sndio audio], sndio, [
+  AC_CHECK_HEADER(sndio.h, HAVE_SNDIO="yes", HAVE_SNDIO="no")
+  if test $HAVE_SNDIO = yes
+  then
+    AC_CHECK_LIB(sndio, sio_open, HAVE_SNDIO="yes", HAVE_SNDIO="no", [])
+    if test $HAVE_SNDIO = yes
+    then
+      SNDIO_LIBS=-lsndio 
+      AC_SUBST(SNDIO_LIBS)
+    fi
+  fi
+])
+
 dnl *** CDParanoia ***
 dnl Note: upstream has a pkg-config file only in post-10.2 SVN so far
 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
@@ -627,10 +642,10 @@ AG_GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparan
     if test "x$FOUND_CDPARANOIA" = "xyes";
     then
       AC_CHECK_LIB(cdda_paranoia,
-                   paranoia_cachemodel_size,
+                   paranoia_init,
                    : ,
                    HAVE_CDPARANOIA=no,
-  		 [-lcdda_interface])
+  		 [-lcdda_interface -lm])
     fi
 
     AC_SUBST(CDPARANOIA_LIBS)
@@ -728,6 +743,7 @@ else
 dnl not building plugins with external dependencies,
 dnl but we still need to set the conditionals
 AM_CONDITIONAL(USE_ALSA, false)
+AM_CONDITIONAL(USE_SNDIO, false)
 AM_CONDITIONAL(USE_CDPARANOIA, false)
 AM_CONDITIONAL(USE_IVORBIS, false)
 AM_CONDITIONAL(USE_LIBVISUAL, false)
@@ -850,6 +866,7 @@ sys/ximage/Makefile
 sys/xvimage/Makefile
 ext/Makefile
 ext/alsa/Makefile
+ext/sndio/Makefile
 ext/cdparanoia/Makefile
 ext/libvisual/Makefile
 ext/ogg/Makefile
